package com.example.demo;

public class TestThread4 implements Runnable{
    int ticketNums=10;
    @Override
    public void run() {
        while (ticketNums > 0) {
            System.out.println(Thread.currentThread().getName() + "拿到了第" + ticketNums-- + "票");
        }
    }

    public static void main(String[] args) {
        TestThread4 testThread4 = new TestThread4();
        new Thread(testThread4,"小明").start();
        new Thread(testThread4,"白洁").start();
        new Thread(testThread4,"胡佳敏").start();

    }
}
